﻿using MiniFox.Components;
using MiniFox.Infrastructure;
using MiniFox.Platform.Models;
using System.Security.Principal;

namespace MiniFox.Platform.Providers
{
    /// <summary>
    /// 票据提供程序
    /// </summary>
    [AutoRegister]
    public interface ITicketProvider
    {
        #region 公共票据管理
        /// <summary>
        /// 保存票据
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="ticket"></param>
        /// <param name="ticketType"></param>
        /// <param name="data">与票据关联的数据</param>
        /// <returns></returns>
        bool SetTicketData<T>(Ticket ticket, TicketType ticketType, T data) where T : class;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="ticket"></param>
        /// <param name="ticketType"></param>
        /// <returns></returns>
        T GetTicketData<T>(Ticket ticket, TicketType ticketType) where T : class;
        /// <summary>
        /// 禁用指定票据
        /// </summary>
        /// <param name="ticket"></param>
        void DisableTicket(Ticket ticket);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="ticket"></param>
        void VerifyTicket(Ticket ticket);
        #endregion
    }

}
